package cn.edu.scau.cmi.tangqingning.simpleFactoryMethod;

public class InsuranceSimpleFactory {
	public static Insurance getInstance(String name) {
		switch(name) {
			case "身体受伤": return new Bruise();
			case "汽车损坏": return new CarDamaged();
			case "人员伤亡": return new Casualty();
			case "多种事故": return new Accidents();
			default : return null;
		}
	}
}
